package com.qqt.csr.im.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 人工客服 im 长连接信息
 * @author yang hao
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description="人工客服 im 长连接信息")
@TableName(value = "csr_im_connection")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Connection implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
    * 主键
    */
    @Schema(description="主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
    * 服务id
    */
    @Schema(description="服务id")
    private Long serviceId;

    @Schema(description="账号ID")
    private Long accountId;

    /**
    * 设备标识
    */
    @Schema(description="设备标识")
    private String deviceFlag;

    /**
    * 设备类型
    */
    @Schema(description="设备类型")
    private Integer deviceType;

    /**
    * 长连接状态
    */
    @Schema(description="长连接状态")
    private Integer state;

    /**
    * 连接时间
    */
    @Schema(description="连接时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date connectionTime;

    /**
    * 断开时间
    */
    @Schema(description="断开时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date disconnectionTime;

    /**
    * 创建时间
    */
    @Schema(description="创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
    * 更新时间
    */
    @Schema(description="更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

}